package com.iflytek.sbd.utils;

import org.springframework.core.env.Environment;

/**
 * @program: myes
 * @description:
 * @author: 陈英俊
 * @create: 2021-09-09 14:27
 */
public class ApplicationPropertiesUtil {

    private ApplicationPropertiesUtil() {
    }

    public static String getProperty(String key) {
        Environment env = SpringContextUtils.getBean(Environment.class);
        return env.getProperty(key);
    }

    public static String getProperty(String key, String defaultValue) {
        Environment env = SpringContextUtils.getBean(Environment.class);
        return env.getProperty(key, defaultValue);
    }
}
